package 多线程;

/**
 * @description: 消费者
 * @author: rock
 * @create:
 **/
public class Consumer implements Runnable {
    private Stack stack;

    public Consumer(Stack stack){
        this.stack = stack;
    }


    public void run() {
        while (true){
            Goods goods = stack.pop();
            try {
                Thread.sleep(1000);

            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }


    }
}
